#include "Raycaster.h"
#include "Ray.h"

Raycaster::Raycaster()
{
	//rayAlgorithm = new Ray();
}

Raycaster::~Raycaster()
{
}

void Raycaster::Render(const World& world)
{
	/*
	    Voor elke verticale lijn van het tekenopp., stuur een straal in de map,
		en bereken de afstand.

		Bereken de geprojecteerde muur hoogte, en teken de muur.
	*/
	/*
	const Vector eyepoint;
	
	Map* worldmap = world.GetMap();

	for(int x=0; x<300; x++)
	{
		Vector raydirection;
		// camera plane & raydirection here

		Vector i = rayAlgorithm->CalculateIntersection(eyepoint, raydirection, worldmap);
		Scalar d = rayAlgorithm->CalculateDistance(eyepoint, i);

		// vector i -> cellx, celly coordinaten
		unsigned int cellx, celly;

		const Cell& cell = worldmap.GetCell(cellx, celly);

		Slice s = cell.GetSlice(i, d);

		unsigned int screenhalf;
		unsigned int sliceheight = s.GetHeight();

		for(unsigned int h=0; h<sliceheight; h++)
		{
			SetPixel(x, screenhalf - (sliceheight/2) + h, s.GetPixel(h));
		}
	}
	*/
}